package com.wzp;

import java.util.ArrayList;

/**
 * Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
 *
 * @author wangzhengpeng
 */
public class HelloConstantOutOfMemory {

    public static void main(String[] args) {
        try {
            ArrayList<String> stringList = new ArrayList<>();
            int item = 0;
            while (true) {
                stringList.add(String.valueOf(item++).intern());
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
}
